<template>
    <Input v-model="v" ref="input" size="small" @on-change="change" placeholder="输入四位数"></Input>
</template>

<script>
    export default {
        props: ['value'],
        data () {
            return {
                v : this.value
            }
        },
        methods: {
            change (){
                this.$emit("change", this.v)
            }
        },
        watch: {
            value (nv){
                this.v = nv
                this.$refs['input'].focus()
            }
        }
    }
</script>